#!/usr/bin/env bash
# yitong.bai@qq.com

function RequirementsDownloadRole() {

  rm -rf "${DATA_DIR}/rpms"
  rm -rf "${DATA_DIR}/pypi"
  rm -rf "${DATA_DIR}/kubespray"
  
  DownloadSystemRequireInstallations "${DATA_DIR}/rpms" "${CONF_DIR}/requirements/rpm_requirements" "${DOWNLOAD_RELEASERVER}"
  #DownloadDockerInstallations "${DATA_DIR}/rpms" "https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/" 
  createrepo "${DATA_DIR}/rpms"

  DownloadKubesprayInstallations "${DATA_DIR}"
  
  InstallCommandIfNotInstalled "python3"
  DownloadAnsibleInstallations "${DATA_DIR}/pypi" "${CONF_DIR}/requirements/pip_requirements"
  DownloadDockerRegistryInstallations "${DATA_DIR}/images"
}
